#include<stdio.h>

int main()
{
    int a;
    char b,c;
    b=getchar();
    a=1;
    while(b!='\n')
    {
    if(b==' '&&c!=' ')
    a++;
    c=b;
    b=getchar();
    }
    printf("%d",a);
    return 0;
}

